package cn.ccbfund.demo.entity;

import java.io.Serializable;

import org.hibernate.validator.constraints.NotBlank;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;

import cn.ccbfund.common.entity.BaseEntity;
import cn.ccbfund.common.util.StringUtils;
import cn.ccbfund.common.validate.ValidateConfig;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
@TableName(Demo.TABLE_NAME)
public class Demo extends BaseEntity<Demo> {

    private static final long serialVersionUID = 1L;

	public static final String TABLE_NAME = "DEMO";
	
    public static final String ID = "ID";
    public static final String CODE = "CODE";
    public static final String NAME = "NAME";

    /**
     * id
     */    
    @TableId
    @NotBlank(message="id不能为空", groups = ValidateConfig.ADD.class)
    private String id;

    /**
     * 代码
     */    
    @NotBlank(message="代码不能为空", groups = ValidateConfig.ADD.class)
    private String code;

    /**
     * 名称
     */    
    @NotBlank(message="名称不能为空", groups = ValidateConfig.ADD.class)
    private String name;

    @Override
	protected Serializable pkVal() {
		return this.id;
	}

    @Override
    public String toString() {
        return StringUtils.describe(this);
    }
	
}
